package com.ihg.hiex.entity.session.during;

import java.beans.Transient;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ihg.hiex.entity.session.Session;
import com.ihg.hiex.entity.user.Assessor;
import com.ihg.hiex.entity.user.Delegate;

/**
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "session_calibration")
public class SessionCalibration {
    
    @Id
    @GeneratedValue
    private Long id;
    
    /** 名称 */
    private String name;
    
    /** lead assessor */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Assessor leadAssessor;
    
    /** peer assessor */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Assessor peerAssessor;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Delegate delegate;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Session session;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public SessionCalibration() {
        
    }
    
    /**
     * 
     * @param name
     * @param leadAssessor
     * @param peerAssessor
     * @param delegate
     * @param session
     */
    public SessionCalibration(String name, Assessor leadAssessor, Assessor peerAssessor, Delegate delegate, Session session) {
        this.name = name;
        this.leadAssessor = leadAssessor;
        this.peerAssessor = peerAssessor;
        this.delegate = delegate;
        this.session = session;
        this.disabled = false;
    }
    
    /**
     * @return the id
     */
    @Transient
    public String getIdString() {
        return id.toString();
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the leadAssessor
     */
    public Assessor getLeadAssessor() {
        return leadAssessor;
    }

    /**
     * @return the peerAssessor
     */
    public Assessor getPeerAssessor() {
        return peerAssessor;
    }

    /**
     * @return the delegate
     */
    public Delegate getDelegate() {
        return delegate;
    }

    /**
     * @return the session
     */
    public Session getSession() {
        return session;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param leadAssessor the leadAssessor to set
     */
    public void setLeadAssessor(Assessor leadAssessor) {
        this.leadAssessor = leadAssessor;
    }

    /**
     * @param peerAssessor the peerAssessor to set
     */
    public void setPeerAssessor(Assessor peerAssessor) {
        this.peerAssessor = peerAssessor;
    }

    /**
     * @param delegate the delegate to set
     */
    public void setDelegate(Delegate delegate) {
        this.delegate = delegate;
    }

    /**
     * @param session the session to set
     */
    public void setSession(Session session) {
        this.session = session;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
